#!/bin/bash
all:client worker master gateway
client:client.o common.o
	gcc -o client client.o common.o -lpthread
worker:worker.o common.o cuckoo.o hash.o 
	gcc -o worker worker.o common.o cuckoo.o hash.o -lgf_complete -lJerasure -lpthread
master:master.o common.o cuckoo.o hash.o arraylist.o
	gcc -o master master.o common.o cuckoo.o hash.o arraylist.o -lpthread
gateway:gateway.o common.o
	gcc -o gateway gateway.o common.o -lpthread
client.o:client.c common.h
	gcc -c client.c
worker.o:worker.c common.h cuckoo.h
	gcc -c worker.c
master.o:master.c common.h cuckoo.h arraylist.h
	gcc -c master.c
gateway.o:gateway.c common.h
	gcc -c gateway.c
common.o:common.c common.h
	gcc -c common.c
cuckoo.o:cuckoo.c cuckoo.h hash.h
	gcc -c cuckoo.c
hash.o:hash.c hash.h
	gcc -c hash.c 
arraylist.o:arraylist.c arraylist.h
	gcc -c arraylist.c
.PHNOY:clean
clean:
	-rm -rf *.o
	-rm -rf worker
	-rm -rf master
	-rm -rf client
	-rm -rf gateway